﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HKEA.CMS.Core.IDAL.App;
using HKEA.CMS.Core.Models;
using HKEA.CMS.Core.DALFactory;
using HKEA.CMS.Core.Utility;
namespace HKEA.CMS.Core.BLL.App
{
    public class app_tblContactInfoBLL
    {
        private Iapp_tblContactInfo IDAL;

        public app_tblContactInfoBLL()
        {
            IDAL = DataAccess.CreateIapp_tblContactInfo();
        }


        /// <summary>
        /// 插入一条记录，返回当前记录的UID ； 并非影响行数
        /// </summary>
        /// <param name="ent"></param>
        /// <returns></returns>
        public int InsertENT(app_tblContactInfo ent)
        {
            int ret = 0;
            if (ent != null)
            {
                try
                {
                    ret = IDAL.InsertENT(ent);
                }
                catch (Exception er)
                {
                    throw;
                }
            }
            return ret;
        }

        public app_tblContactInfo GetAppENTByENT(app_tblContactInfo ent)
        {
            app_tblContactInfo ret = null;
            if (ent != null)
            {
                try
                {
                    ret = IDAL.GetAppENTByENT(ent);
                }
                catch (Exception er)
                { throw; }
            }
            return ret;
        }
        public int UpdateENT(app_tblContactInfo ent)
        {
            int ret = 0;
            if (ent != null)
            {
                try
                {
                    ret = IDAL.UpdateENT(ent);
                }
                catch (Exception er)
                { throw; }
            }
            return ret;
        }

        public int DeleteByKeyList(List<int> list)
        {
            int ret = 0;
            if (list.Count > 0)
            {
                try { ret = IDAL.DeleteByKeyList(list); }
                catch (Exception er) { throw; }
            }
            return ret;
        }

        public int DeleteENT(app_tblContactInfo ent)
        {
            int ret = 0;
            if (ent != null)
            {
                try
                {
                    ret = IDAL.DeleteENT(ent);
                }
                catch (Exception er)
                { throw; }
            }
            return ret;
        }
    }
}
